package com.car.shopping.client;

import com.car.commons.core.model.Result;
import com.car.shopping.client.model.user.SelectAdminDto;
import com.car.shopping.client.model.user.SelectById;
import com.car.shopping.client.model.user.UserDto;
import com.car.shopping.client.model.user.UserIdRequest;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Set;

@FeignClient(name = "car-account",path = "/account")
public interface CarAccountClient {
    /**
     * 根据用户id查名字
     */
    @PostMapping("/user/findUserNicknameById.ty")
    Result<String> findUserNicknameById(@RequestBody UserIdRequest request) throws Exception;

    /**
     * 根据用户id查用户信息
     */
    @GetMapping("/user/findUserById/{userId}.ty")
    public Result<UserDto> findUserById(@PathVariable("userId") Integer userId) throws Exception;
    /**
     * 根据管理员id查管理员信息
     */
    @GetMapping("/admin/selectById.ty")
    public Result<SelectById> selectById(@RequestParam("adminId") Integer adminId) throws Exception;


    @GetMapping("/admin/adminsByIds.ty")
    public Result<List<SelectAdminDto>> findsAdminByIds(@RequestParam("adminIds") Set<Integer> adminIds) throws Exception;

    }
